# Step must like these.
# 1. bximage generate pm.img(fd);
# 2. make
# 3. bochs;
# 4. format b: in bochs.
# 5. make mount_img. (Before this step, need mkdir /mnt/flopply. )
# 6. enter b:\ in bochs.
# 7. excute pmtest2.com in bochs.
#

source_name = pmtest2

all: $(source_name).asm
	nasm ../generate_boot.asm -o boot.bin
	dd if=boot.bin of=pm.img bs=512 count=1 conv=notrunc
	nasm $(source_name).asm -o $(source_name).com

.PHONY:
mount_img:
	mount -o loop pm.img /mnt/floppy
	cp $(source_name).com /mnt/floppy
	umount /mnt/floppy

clean:
	rm -rf *.com *.img *.bin

